{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "6cce5e50",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-- 运行结果: start_depth 21, start_width 20, qr_map_depth 101, qr_map_width 4, qr_move_depth 101, qr_move_width 4 --\n"
     ]
    }
   ],
   "source": [
    "from qiskit import QuantumCircuit, qasm3\n",
    "from quantum_chip import QuantumChip\n",
    "from hardware import HardwareParams\n",
    "from qrmove_compiler import QRMoveCompiler\n",
    "from utils import get_quantum_circuit\n",
    "\n",
    "# bv qaoa mod mul qram rd sym xor\n",
    "\n",
    "_type = \"xor\"\n",
    "_qubit_num = 20  # 395行 * 100列\n",
    "quantum_circuit: QuantumCircuit = get_quantum_circuit(_type, _qubit_num)\n",
    "quantum_chip = QuantumChip(\n",
    "    \"square\",\n",
    "    50,\n",
    ")\n",
    "extra_qubit_num = 2\n",
    "# quantum_chip.visualize()\n",
    "hardware_param = HardwareParams(\n",
    "    time_1q=300.0,  # 单比特门时间\n",
    "    time_2q=300.0,  # 双比特门时间\n",
    "    time_meas=4000.0,  # 测量时间\n",
    "    time_reset=1000.0,  # 重置时间\n",
    ")\n",
    "qmc = QRMoveCompiler(quantum_circuit, quantum_chip, hardware_param, extra_qubit_num)\n",
    "(\n",
    "    start_depth,\n",
    "    start_width,\n",
    "    qr_map_depth,\n",
    "    qr_map_width,\n",
    "    qr_move_depth,\n",
    "    qr_move_width,\n",
    ") = qmc.compile_program()\n",
    "print(\n",
    "    f\"-- 运行结果: start_depth {start_depth}, start_width {start_width}, qr_map_depth {qr_map_depth}, qr_map_width {qr_map_width}, qr_move_depth {qr_move_depth}, qr_move_width {qr_move_width} --\"\n",
    ")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
